package com.bdqn.service;

import com.bdqn.dao.StudentDao;
import com.bdqn.dao.StudentDaoImpl;
import com.bdqn.pojo.Student;

import java.util.List;

/**
 * StudentServiceImpl
 *
 * @author LILIBO
 * @since 2021-11-24
 */
public class StudentServiceImpl implements StudentService {

    private StudentDao studentDao = new StudentDaoImpl();

    /**
     * 添加学生信息
     *
     * @param student
     * @return
     */
    @Override
    public int add(Student student) {
        return studentDao.add(student);
    }

    /**
     * 修改学生信息
     *
     * @param student
     * @return
     */
    @Override
    public int update(Student student) {
        return studentDao.update(student);
    }

    /**
     * 删除学生信息
     *
     * @param id
     * @return
     */
    @Override
    public int delete(int id) {
        return studentDao.delete(id);
    }

    /**
     * 根据ID获得学生信息
     *
     * @param id
     * @return
     */
    @Override
    public Student getById(int id) {
        return studentDao.getById(id);
    }

    /**
     * 根据查询信息获得学生列表
     *
     * @param query 查询信息
     * @return
     */
    @Override
    public List<Student> getList(Student query) {
        return studentDao.getList(query);
    }
}
